package com.chefu.common.net.result;

import android.util.Log;


import com.chefu.common.net.result.data.HttpResult;

import rx.functions.Func1;


/**
 * Created by Administrator on 2016/8/11 0011.
 */
public class HttpResultFunc<T> implements Func1<HttpResult<T>, T> {



    private static final String TAG = "HttpResultFunc";

    public HttpResultFunc() {

    }

    @Override
    public T call(HttpResult<T> tHttpResult) {
        if (tHttpResult == null)
            return null;

        int code = tHttpResult.getCode();

        if (code == 1) {
            Log.d(TAG, "call() returned:connect failure");
        }
        return tHttpResult.getListData();
    }
}
